<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<ui:composition template="/templatePrincipal.xhtml" xmlns="http://www.w3.org/1999/xhtml"
                xmlns:ui="http://java.sun.com/jsf/facelets"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:f="http://java.sun.com/jsf/core"
                xmlns:a4j="http://richfaces.org/a4j"
                xmlns:s="http://jboss.com/products/seam/taglib"
                xmlns:rich="http://richfaces.org/rich">

    <ui:define name="conteudo">
        <script type="text/javascript">
            function limparCampos(){
                document.getElementById("fContato:itNome").value = '';
                document.getElementById("fContato:itEmail").value = '';
                document.getElementById("fContato:itAssunto").value = '';
                document.getElementById("fContato:itMensagem").value = '';
            }
        </script>
        <rich:spacer height="20"/>
        <center>
            <rich:messages layout="table"
                           errorClass="errorClass"
                           infoClass="infoClass"
                           warnClass="warnClass"
                           styleClass="painelMensagem"
                           ajaxRendered="true"/>
        </center>
        <rich:spacer height="10"/>
        <rich:panel switchType="client">
            <f:facet name="header">
                Entre em contato conosco
            </f:facet>

            <h:form id="fContato">
                <h:panelGrid cellspacing="2" cellpadding="2" columns="2" columnClasses="field-names, fields">
                    <h:outputLabel for="itNome" styleClass="required-black">
                        Nome:
                    </h:outputLabel>
                    <h:inputText id="itNome" required="true" onchange="validaLogin()" value="#{faleConoscoAction.email.paramNome}" styleClass="fonte"/>

                    <h:outputLabel for="itEmail" styleClass="required-black" rendered="#{!identity.loggedIn}">
                        E-mail:
                    </h:outputLabel>
                    <h:inputText id="itEmail" required="true" value="#{faleConoscoAction.email.paramEmail}" style="width:150px;" rendered="#{!identity.loggedIn}"/>

                    <h:outputLabel for="itAssunto" styleClass="required-black">
                        Assunto:
                    </h:outputLabel>
                    <h:inputText id="itAssunto" required="true" value="#{faleConoscoAction.email.paramAssunto}" style="width:150px;"/>

                    <h:outputLabel  for="itMensagem" styleClass="required-black">
                        Mensagem:
                    </h:outputLabel>
                    <h:inputTextarea id="itMensagem" required="true" value="#{faleConoscoAction.email.paramMensagem}" style="width:350px;height:100px;"/>

                </h:panelGrid>
                <br/>
                <h:panelGrid columns="2" style="padding-left:290px;">
                    <h:commandLink id="clEnviar"
                                   action="#{faleConoscoAction.enviarEmail}"

                                   styleClass="link dr-toolbar-ext rich-toolbar">
                        <h:graphicImage value="/resources/images/edit-redo.png"/>
                        <h:outputText value="Enviar"/>
                    </h:commandLink>

                    <h:commandLink id="clLimpar"
                                   immediate="true"
                                   onclick="limparCampos()"
                                   styleClass="link dr-toolbar-ext rich-toolbar">
                        <h:graphicImage value="/resources/images/edit-clear.png"/>
                        <h:outputText value="Limpar"/>
                    </h:commandLink>
                </h:panelGrid>
            </h:form>
        </rich:panel>
    </ui:define>
</ui:composition>